tools: libxl: constify parameter to libxl__abs_path
authorIan Campbell <ian.campbell@citrix.com>
Tue, 24 May 2011 17:22:23 +0000 (18:22 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 24 May 2011 17:22:23 +0000 (18:22 +0100)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_internal.c
tools/libxl/libxl_internal.h

index 046e4435c794fe7e7db78e3630d4f5688f2b39f7..f1e0daa1da82904c3625b2ec63b516787dbaeb3b 100644 (file)
@@ -184,10 +184,10 @@ void libxl__log(libxl_ctx *ctx, xentoollog_level msglevel, int errnoval,
     va_end(ap);
 }
 
-char *libxl__abs_path(libxl__gc *gc, char *s, const char *path)
+char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path)
 {
     if (!s || s[0] == '/')
-        return s;
+        return libxl__strdup(gc, s);
     return libxl__sprintf(gc, "%s/%s", path, s);
 }
 
index b032e7fa8ec642bbf4e930ab136fa2b3bc8f76c5..babc44a3a25f5e0e7805cf846e6ea579e96b50bf 100644 (file)
@@ -309,7 +309,7 @@ _hidden void libxl__exec(int stdinfd, int stdoutfd, int stderrfd,
 _hidden void libxl__log_child_exitstatus(libxl__gc *gc,
                                 const char *what, pid_t pid, int status);
 
-_hidden char *libxl__abs_path(libxl__gc *gc, char *s, const char *path);
+_hidden char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path);
 
 #define LIBXL__LOG_DEBUG   XTL_DEBUG
 #define LIBXL__LOG_INFO    XTL_INFO